/**
 * add by: hong.rong 2020/08/16
 * name:
 * notes:
 */

import React from 'react'
import classNames from 'classnames'
import { isFunction } from 'lodash'
import styles from './Card.less'

const COLOR = {
  GREEN: 'green',
  BLUE: 'blue',
  RED: 'red',
  ORANGE: 'orange',
}

export default function Card({
  children,
  type = 'green',
  className = '',
  handleClick,
}) {
  return (
    <div
      className={classNames(styles['card'], styles[`bg-${type}`], className)}
      onClick={() => isFunction(handleClick) && handleClick()}
    >
      {children}
    </div>
  )
}
Card.COLOR = COLOR
